package com.example.addemoone.kotlin

fun main() {
    letDemo()
}

fun letDemo() {
    val name: String? = "ZhangSanFeng"
    val res = name?.let {
        println("NameLength: ${it.length}") // 仅当 name 不为 null 时执行
        it.uppercase()  // 最后一行为返回值
    }
    println(res)
}